angular.module('app.directives')

.directive('datTable', [function() {
    return {
        restrict: 'EA',
        templateUrl: 'directive/table/dataTable.html',
        replace: true,
        scope: false,
        link: function($scope, element, attrs) {
            $scope.$watch(attrs.data, function(newValue, oldValue, scope) {
                $scope.data = newValue;
            }, true);
        }
    }
}])

.directive('pointTable', [function() {
    return {
        restrict: 'EA',
        templateUrl: 'directive/table/dataTable.html',
        replace: true,
        scope: true,
        link: function($scope, element, attrs) {
            $scope.$watch(attrs.data, function(newValue, oldValue, scope) {
                $scope.data = newValue;
            }, true);
        }
    }
}])

.directive('profileTable', [function() {
    return {
        restrict: 'EA',
        templateUrl: 'directive/table/profileTable.html',
        replace: true,
        scope: true,
        link: function($scope, element, attrs) {
            $scope.contentType = attrs.contentType;
            $scope.$watch(attrs.data, function(newValue, oldValue, scope) {
                $scope.data = newValue;
            }, true);
        }
    }
}])


